package br.com.edoc.entidade;




import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import javax.persistence.Table;



import br.com.edoc.anotation.DipValidation;
import br.com.edoc.anotation.DipValidationField;

@Entity
@Table (name="MODULO")
@DipValidation(disable=false)
public class Modulo implements EntidadePadrao{

	public String getImg() {
		return img;
	}

	public void setImg(String img) {
		this.img = img;
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = -7638129776760271842L;
	@Id  
	@Column(name = "MOD_IDDOOBJETO", nullable = false)  
	@GeneratedValue(strategy=GenerationType.IDENTITY)  
	private Integer id;
	@Column(name = "MOD_DESCRICAO", nullable = false, length=50) 
	@DipValidationField(msgObrigatoriedade="Campo",msgEstoroTamanho="sdfsd",tamanhoMinimo=3,tamanhoMaximo=50)
	private String nome;
	@Column(name = "MOD_URL", nullable = false, length=250) 
	@DipValidationField(msgObrigatoriedade="Campo nome é Obrigatório",msgEstoroTamanho="minimo 3 maximo 250",tamanhoMinimo=3,tamanhoMaximo=250)
	private String url;
	@Column(name = "MOD_IMG", nullable = false, length=50)
	private String img;
	

	@Override
	public Integer getId() {
		// TODO Auto-generated method stub
		return id;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}



	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Modulo other = (Modulo) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

}
